package org.nepu.srr.作业井风险.作业井风险;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.nepu.sc.domain.DataVO;
import org.nepu.sc.domain.CommonMethods;

@Data
@ApiModel(value = "作业井风险参数")
public class B11OperationWellRiskParams {

    @ApiModelProperty(value = "井类别")
    DataVO wellCategory;

    @ApiModelProperty(value = "气油比")
    DataVO gasOilRatio;

    @ApiModelProperty(value = "地层压力（MPa）")
    DataVO groundPressure;

    @ApiModelProperty(value = "水深（m）")
    DataVO waterDepth;

    @ApiModelProperty(value = "地层硫化氢含量（%）")
    DataVO sulfurContent;

    @ApiModelProperty(value = "地层压力窗口当量密度（Kg/m3）")
    DataVO pressureWindowDensity;

    @ApiModelProperty(value = "浅层气风险")
    DataVO shallowGasRisk;

    public B11OperationWellRiskResult rate(){

        double fullScore = 70;
        double rateScore = 0.0;
        if (wellCategory.getData().equals("区域第一口探井") || wellCategory.getData().equals("新领域新层系预探井")){
            rateScore = rateScore + 10;
        }
        if (gasOilRatio.getData().equals("350及以上") || gasOilRatio.getData().equals("350以下")){
            rateScore = rateScore + 10;
        }
        if (groundPressure.getData().equals("20000psi及以上") || groundPressure.getData().equals("15000psi（含）～20000psi") || groundPressure.getData().equals("10000psi（含）～15000psi") || groundPressure.getData().equals("10000psi以下")){
            rateScore = rateScore + 10;
        }
        if (waterDepth.getData().equals("3000米及以上") || waterDepth.getData().equals("1500米（含）～3000米") || waterDepth.getData().equals("1000米（含）～1500米")){
            rateScore = rateScore + 10;
        }
        if (sulfurContent.getData().equals("5000ppm及以上") || sulfurContent.getData().equals("1000ppm（含）～5000ppm")){
            rateScore = rateScore + 10;
        }
        if (pressureWindowDensity.getData().equals("0.06g/cm3及以下") || pressureWindowDensity.getData().equals("0.06g/cm3～0.12g/cm3（含）")){
            rateScore = rateScore + 10;
        }
        if (shallowGasRisk.getData().equals("中等及以上")){
            rateScore = rateScore + 10;
        }
        double score = rateScore / fullScore;
        B11OperationWellRiskResult result = new B11OperationWellRiskResult();
        result.setRateScore(score);
        String s = CommonMethods.toGrade(score);
        result.setRateResult(s);

        return result;
    }

}
